Image encoding device, image encoding method, and image encoding program, and image decoding device, image decoding method, and image decoding program

ABSTRACT

An image encoding device adapted to segment an image into blocks and encode the image in units of blocks resulting from segmenting the image is provided. A block segmentation unit recursively segments the image into rectangles of a predetermined size to generate a block subject to encoding. A bitstream generation unit encodes block segmentation information of the block subject to encoding. The block segmentation unit includes: a quartering unit that quarters a target block in recursive segmentation in a horizontal direction and a vertical direction to generate four blocks; and a halving unit that halves a target block in recursive segmentation in a horizontal or vertical direction to generate two blocks. When previous recursive segmentation is halving, the halving unit prohibits a target block subject to current recursive segmentation from being segmented in the same direction as a direction in which the block was segmented in the previous recursive segmentation.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a Continuation of U.S. Ser. No. 16/353,121, filedMar. 14, 2019; which is a Continuation of International Application No.:PCT/JP2017/021783, filed Jun. 13, 2017; which claims the benefit ofpriority from the prior Japanese Patent Application No. 2016-236507,filed on Dec. 6, 2016, the entire contents of which are incorporatedherein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a technology of segmenting an imageinto blocks and encoding and decoding the image in units of blocksresulting from segmenting the image.

2. Description of the Related Art

In image encoding and decoding, an image is segmented into blocks, eachof which is a set of a predetermined number of pixels. The image isencoded and decoded in units of blocks. By performing proper blocksegmentation, the efficiency of intra-picture prediction (intraprediction), inter-picture prediction (inter prediction), orthogonaltransform, entropy encoding, etc. is improved. As a result, the encodingefficiency is improved.

[patent document 1] JP2015-526008

Unless an image is segmented into blocks of proper sizes and shapes, theencoding efficiency is reduced. If an image is not segmented into blocksof proper sizes and shapes, the processing volume in the subsequentencoding and decoding will be increased.

SUMMARY OF THE INVENTION

The present invention addresses the aforementioned issue, and a purposethereof is to provide a technology of improving the encoding efficiencyby performing block segmentation suited to image encoding and decoding.

An image encoding device according to an embodiment is adapted tosegment an image into blocks and encode the image in units of blocksresulting from segmenting the image and includes: a block segmentationunit (101) that recursively segments the image into rectangles of apredetermined size to generate a block subject to encoding; and anencoding unit (105) that encodes block segmentation information of theblock subject to encoding. The block segmentation unit includes: aquartering unit that quarters a target block in recursive segmentationin a horizontal direction and a vertical direction to generate fourblocks; and a halving unit that halves a target block in recursivesegmentation in a horizontal direction or a vertical direction togenerate two blocks. When previous recursive segmentation is halving,the halving unit prohibits a target block subject to current recursivesegmentation from being segmented in the same direction as a directionin which the block was segmented in the previous recursive segmentation.

Another embodiment also relates to an image encoding device. The deviceis adapted to segment an image into blocks and encode the image in unitsof blocks resulting from segmenting the image and includes: a blocksegmentation unit (101) that recursively segments the image intorectangles of a predetermined size to generate a block subject toencoding; and an encoding unit (105) that encodes block segmentationinformation of the block subject to encoding. The block segmentationunit includes: a quartering unit that quarters a target block inrecursive segmentation in a horizontal direction and a verticaldirection to generate four blocks; and a halving unit that halves atarget block in recursive segmentation in a horizontal direction or avertical direction to generate two blocks. When the last but onerecursive segmentation is halving and previous recursive segmentation isquartering, the block segmentation unit prohibits further segmentationof the target block.

Still another embodiment relates to an image encoding method. The methodis adapted to segment an image into blocks and encode the image in unitsof blocks resulting from segmenting the image and includes: recursivelysegmenting the image into rectangles of a predetermined size to generatea block subject to encoding; and encoding block segmentation informationof the block subject to encoding. The segmenting includes: quartering atarget block in recursive segmentation in a horizontal direction and avertical direction to generate four blocks; and halving a target blockin recursive segmentation in a horizontal direction or a verticaldirection to generate two blocks. When previous recursive segmentationis halving, the halving prohibits a target block subject to currentrecursive segmentation from being segmented in the same direction as adirection in which the block was segmented in the previous recursivesegmentation.

Still another embodiment relates to an image decoding device. The deviceis adapted to decode an image in units of blocks resulting fromsegmenting the image and includes: a block segmentation unit (202) thatgenerates a block subject to decoding based on decoded recursive blocksegmentation information; and a decoding unit (203, 204, 205) thatdecodes the block subject to decoding. The block segmentation unitincludes: a quartering unit that quarters a target block in recursivesegmentation in a horizontal direction and a vertical direction togenerate four blocks; and a halving unit that halves a target block inrecursive segmentation in a horizontal direction or a vertical directionto generate two blocks. When previous recursive segmentation is halving,the decoding unit does not decode a flag indicating whether to segment atarget block subject to current recursive segmentation in the samedirection as a direction in which the block was segmented in theprevious recursive segmentation.

Still another embodiment also relates to an image decoding device. Thedevice is adapted to decode an image in units of blocks resulting fromsegmenting the image and includes: a block segmentation unit (202) thatgenerates a block subject to decoding based on decoded recursive blocksegmentation information; and a decoding unit that (203, 204, 205)decodes the block subject to decoding. The block segmentation unitincludes: a quartering unit that quarters a target block in recursivesegmentation in a horizontal direction and a vertical direction togenerate four blocks; and a halving unit that halves a target block inrecursive segmentation in a horizontal direction or a vertical directionto generate two blocks. When the last but one recursive segmentation ishalving and previous recursive segmentation is quartering, the decodingunit does not decode a flag indicating whether to segment the targetblock further.

Still another embodiment relates to an image decoding method. The methodis adapted to decode an image in units of blocks resulting fromsegmenting the image and includes: generating a block subject todecoding based on decoded recursive block segmentation information; anddecoding the block subject to decoding. The segmenting includes:quartering a target block in recursive segmentation in a horizontaldirection and a vertical direction to generate four blocks; and halvinga target block in recursive segmentation in a horizontal direction or avertical direction to generate two blocks. When previous recursivesegmentation is halving, the decoding does not decode a flag indicatingwhether to segment a target block subject to current recursivesegmentation in the same direction as a direction in which the block wassegmented in the previous recursive segmentation.

Optional combinations of the aforementioned constituting elements, andimplementations of the embodiments in the form of methods, apparatuses,systems, recording mediums, and computer programs may also be practicedas additional modes of the embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments will now be described, by way of example only, withreference to the accompanying drawings which are meant to be exemplary,not limiting, and wherein like elements are numbered alike in severalFigures, in which:

FIG. 1 shows a configuration of an image encoding device according tothe first embodiment;

FIG. 2 shows a configuration of an image decoding device according tothe first embodiment;

FIG. 3 is a flowchart showing segmentation into tree blocks andsegmentation within a tree block;

FIG. 4 shows how an input image is segmented into tree blocks;

FIG. 5 shows z-scan;

FIG. 6 shows a tree block quartered in the horizontal and verticaldirections;

FIG. 7 shows a tree block halved in the horizontal direction;

FIG. 8 shows a tree block halved in the vertical direction;

FIG. 9 is a flowchart showing a process in each block resulting fromquartering a tree block in the horizontal direction and the verticaldirection;

FIG. 10 is a flowchart showing a process in each block resulting fromhalving a tree block in the horizontal direction;

FIG. 11 shows how a block resulting from halving a tree block in thehorizontal direction is re-segmented;

FIG. 12 is a flowchart showing a process in each block resulting fromhalving a tree block in the vertical direction;

FIG. 13 shows how a block resulting from halving a tree block in thevertical direction is re-segmented;

FIG. 14 shows an example of syntax related to block segmentationaccording to the first embodiment;

FIGS. 15A-15D show intra prediction;

FIG. 16 shows inter prediction;

FIG. 17 shows an example of syntax related to block segmentationaccording to the second embodiment;

FIG. 18 shows another example of syntax related to block segmentationaccording to the second embodiment;

FIG. 19 shows an example of syntax related to block segmentationaccording to the third embodiment;

FIG. 20 shows how a block resulting from halving a parent block in thehorizontal direction or the vertical direction is further segmentedinside in the same direction;

FIG. 21 shows an example of syntax related to block segmentationaccording to the fourth embodiment; and

FIG. 22 shows quartering of a block resulting from halving a tree block.

DETAILED DESCRIPTION OF THE INVENTION

The invention will now be described by reference to the preferredembodiments. This does not intend to limit the scope of the presentinvention, but to exemplify the invention.

Embodiments of the present invention provide an image encodingtechnology of segmenting an image into rectangular blocks and encodingand decoding a segment block.

First Embodiment

A description will be given of an image encoding device 100 and an imagedecoding device 200 according to the first embodiment. In the firstembodiment, a block is restricted from being segmented successively inthe same direction recursive block segmentation.

FIG. 1 shows a configuration of the image encoding device 100 accordingto the first embodiment; It should be noted that FIG. 1 only shows aflow of data related to an image signal. Additional information (e.g., amotion vector, a prediction mode, etc.) other than an image signal issupplied by relevant constituting elements to a bitstream generationunit 105 to generate associated encoded data, but the figure does notshow a flow of data related to the additional information.

The block segmentation unit 101 segments an image into blocks subject toencoding, each of which is a unit of processing in encoding, andsupplies an image signal in the block subject to encoding to a residualsignal generation unit 103. Further, the block segmentation unit 101supplies an image signal of a block subject to encoding to a predictedimage generation unit 102 to evaluate a matching score of a predictedimage.

The block segmentation unit 101 recursively segments an image intorectangles of a predetermined size to generate blocks subject toencoding. The block segmentation unit 101 includes a quartering unitthat quarters a target block in recursive segmentation in the horizontaldirection and the vertical direction to generate four blocks and ahalving unit that halves a target block in recursive segmentation in thehorizontal direction or the vertical direction to generate two blocks.The detailed operation of the block segmentation unit 101 will bedescribed later.

The predicted image generation unit 102 performs intra-pictureprediction (intra prediction) or inter-picture prediction (interprediction) from a decoded image signal supplied from a decoded imagememory 108 by referring to a prediction mode, thereby generating apredicted image signal. The image signal in the block subject toencoding supplied from the block segmentation unit 101 is used forevaluation of intra prediction and inter prediction. In intraprediction, a predicted image signal is generated by using the imagesignal of the block subject to encoding supplied from the blocksegmentation unit 101 and an image signal, supplied from the decodedimage memory 108, of an encoded block neighboring the block subject toencoding and located in the same picture as the block subject toencoding. In inter prediction, an encoded picture, located before orafter a picture including the block subject to encoding (encodingpicture) in the time series and stored in the decoded image memory 108,is defined as a reference picture. An image signal of the block subjectto encoding supplied from the block segmentation unit 101 is subject toevaluation for the degree of block-to-block coincidence (for example,subject to block matching) between the encoding picture and thereference picture. A motion vector indicating an amount of movement isdetermined, and a predicted image signal is generated by performingmotion compensation based on the amount of movement from the referencepicture. The predicted image generation unit 102 supplies the predictedimage signal thus generated to the residual signal generation unit 103.

The residual signal generation unit 103 subtracts the predicted signalgenerated by the predicted image generation unit 102 from the imagesignal subject to encoding to generate a residual signal and suppliesthe residual signal to an orthogonal transform/quantization unit 104.

The orthogonal transform/quantization unit 104 subjects the residualsignal supplied from the residual signal generation unit 103 toorthogonal transform and quantization and supplies the orthogonallytransformed and quantized residual signal to the bitstream generationunit 105 and an inverse-quantization/inverse-orthogonal transform unit106.

The bitstream generation unit 105 generates a bitstream corresponding tothe orthogonally transformed and quantized residual signal supplied fromthe orthogonal transform/quantization unit 104. The bitstream generationunit 105 also generates a bitstream corresponding to additionalinformation such as the motion vector, prediction mode, and blocksegmentation information.

The inverse-quantization/inverse-orthogonal transform unit 106 subjectsthe orthogonally transformed and quantized residual signal supplied fromthe orthogonal transform/quantization unit 104 toinverse-quantization/inverse-orthogonal transform and supplies theresidual signal subjected to inverse-quantization and inverse-orthogonaltransform to a decoded image signal superimposition unit 107.

The decoded image signal superimposition unit 107 superimposes thepredicted image signal generated by the predicted image generation unit102 and the residual signal subjected to inverse-quantization andinverse-orthogonal transform by theinverse-quantization/inverse-orthogonal transform unit 106 one upon theother so as to generate a decoded image. The decoded image signalsuperimposition unit 107 stores the decoded image in the decoded imagememory 108. The decoded image may be subject to filtering for reducingblock distortion, etc. resulting from encoding before being stored inthe decoded image memory 108.

FIG. 2 shows a configuration of an image decoding device 200 accordingto the first embodiment. It should be noted that FIG. 2 only shows aflow of data related to an image signal. Additional information (e.g., amotion vector, a prediction mode, etc.) other than an image signal issupplied by a bitstream decoding unit 201 to relevant constitutingelements and used in an associated process, but the figure does not showa flow of data related to the additional information.

The bitstream decoding unit 201 decodes the supplied bitstream andsupplies the orthogonally transformed and quantized residual signal to ablock segmentation unit 202.

The block segmentation unit 202 determines the shape of a block subjectto decoding based on the decoded block segmentation information andsupplies the orthogonally transformed and quantized residual signal ofthe block subject to decoding thus determined to aninverse-quantization/inverse-orthogonal transform unit 203.

The block segmentation unit 202 recursively segments the image intorectangles of a predetermined size based on the decoded blocksegmentation information to generate a block subject to decoding. Theblock segmentation unit 202 includes a quartering unit that quarters atarget block in recursive segmentation in the horizontal direction andthe vertical direction to generate four blocks and a halving unit thathalves a target block in recursive segmentation in the horizontaldirection or the vertical direction to generate two blocks. The detailedoperation of the block segmentation unit 202 will be described later.

The inverse-quantization/inverse-orthogonal transform unit 203 subjectsthe orthogonally transformed and quantized residual signal supplied toinverse-quantization and inverse-orthogonal transform so as to obtain aresidual signal subjected to inverse-quantization and inverse-orthogonaltransform.

The predicted image generation unit 204 generates a predicted imagesignal from the decoded image signal supplied from a decoded imagememory 206 and supplies the predicted image to a decoded image signalsuperimposition unit 205.

The decoded image signal superimposition unit 205 superimposes predictedimage signal generated by the predicted image generation unit 204 andthe residual signal subjected to inverse-quantization andinverse-orthogonal transform by theinverse-quantization/inverse-orthogonal transform unit 203 one upon theother so as to generate and output a decoded image signal. The decodedimage signal superimposition unit 205 stores the decoded image signal inthe decoded image memory 206. The decoded image may be subject tofiltering for reducing block distortion, etc.

resulting from encoding before being stored in the decoded image memory206.

A detailed description will be given of the operation of the blocksegmentation unit 101 of the image encoding device 100. FIG. 3 is aflowchart showing segmentation into tree blocks and segmentation withina tree block.

First, an input image is segmented into tree blocks of a predeterminedsize (S1000). For example, a tree block includes 128 pixels×128 pixels.However, a tree block need not necessarily include 128 pixels×128pixels.

Any size and shape may be used so long as the tree block is rectangular.The fixed values defining the size and shape of a tree block may beestablished in the encoding device and the decoding device. The encodingdevice may determine the size and shape and record the size and shape inthe bitstream, and the decoding device may use the recorded block size.FIG. 4 shows how an input image is segmented into tree blocks. Treeblocks are encoded and decoded in the order of raster scan, i.e., fromleft to right and from top to bottom.

A tree block is further segmented inside into rectangular blocks. A treeblock is encoded and decoded inside in the order of z-scan. FIG. 5 showsthe order of z-scan. In z-scan, the top left block, the top right block,the bottom left block, and the bottom right block are encoded anddecoded in the stated order. A tree block can be quartered or halvedinside. In quartering, a tree block is segmented in the horizontaldirection and the vertical direction. In halving, a tree block issegmented in the horizontal direction or the vertical direction. FIG. 6shows a tree block quartered in the horizontal and vertical directions.FIG. 7 shows a tree block halved in the horizontal direction. FIG. 8shows a tree block halved in the vertical direction.

Reference is made back to FIG. 3. A determination is made as to whetherto quarter a tree block inside in the horizontal direction and thevertical direction

(S1001).

When it is determined to quarter the tree block inside (S1001: Yes), thetree block is quartered inside (S1002), and the blocks resulting fromquartering the tree block in the horizontal and vertical directions areprocessed respectively (S1003). Re-segmentation of the blocks resultingfrom quartering the tree block will be described later (FIG. 9).

When it is determined not to quarter the tree block inside (S1001: No),a determination is made as to whether to halve the tree block inside(S1004).

When it is determined to halve the tree block inside (S1004: Yes), adetermination is made as to whether to halve the tree block in thehorizontal direction (S1005).

When it is determined to halve the block in the horizontal direction(S1005: Yes), the tree block is halved inside in the horizontaldirection (S1006), and the blocks resulting from halving the tree blockin the horizontal direction are processed respectively (S1007).Re-segmentation of the blocks resulting from halving the tree block inthe horizontal direction will be described later (FIG. 10).

When it is determined to halve the tree block in the vertical directioninstead of the horizontal direction (S1005: No), the tree block ishalved inside in the vertical direction (S1008), and the blocksresulting from halving the tree block in the vertical direction areprocessed respectively (S1009). Re-segmentation of the blocks resultingfrom halving the tree block in the vertical direction will be describedlater (FIG. 11).

When it is determined not to halve the tree block inside (S1004: No),the tree block is not segmented inside and the block segmentationprocess is terminated (S1010).

A description will now be given of a process of each block resultingfrom quartering the tree block in the horizontal and vertical directionswith reference to the flowchart of FIG. 9.

A determination is made as to whether to quarter a block inside again inthe horizontal and vertical directions (S1101).

When it is determined to quarter the block inside again (S1101: Yes),the block is quartered inside again (S1102), and the blocks resultingfrom quartering the block in the horizontal and vertical directions areprocessed respectively (S1103).

When it is determined not to quarter the block inside again (S1101: No),a determination is made as to whether to halve the block inside (S1104).

When it is determined to halve the block inside (S1104: Yes), adetermination is made as to whether to halve the block in the horizontaldirection (S1105).

When it is determined to halve the block in the horizontal direction(S1105: Yes), the block is halved inside in the horizontal direction(S1106), and the blocks resulting from halving the block in thehorizontal direction are processed respectively (S1107).

When it is determined to halve the lock in the vertical directioninstead of the horizontal direction (S1105: No), the block is halvedinside in the vertical direction (S1108), and the blocks resulting fromhalving the block in the vertical direction are processed respectively(S1109).

When it is determined not to halve the block inside (S1104: No), theblock is not segmented inside and the block segmentation process isterminated (S1110).

The process shown in the flowchart of FIG. 9 is performed for each blockresulting from the quartering. The blocks resulting from quartering ablock is also encoded and decoded inside in the order of z-scan.

A description will now be given of the process of each block resultingfrom halving a tree block in the horizontal direction with reference tothe flowchart of FIG. 10.

When a tree block is halved in the horizontal direction, a determinationis made as to whether to quarter each block resulting from halving thetree block in the horizontal and vertical directions inside (S1201).

When it is determined to quarter the block inside (S1201: Yes), theblock is quartered inside (S1202), and the blocks resulting fromquartering the block in the horizontal and vertical directions areprocessed respectively (S1203).

When it is determined not to quarter the block inside (S1201: No), adetermination is made as to whether to halve the block inside again(S1204).

When it is determined to halve the block again (S1204: Yes), the blockis halved inside in the vertical direction (S1205), and the blocksresulting from halving the block in the vertical direction are processedrespectively (S1206).

When it is determined not to halve the block again (S1204: No), theblock is not segmented inside again and the block segmentation processis terminated (S1207).

FIG. 11 shows how a block resulting from halving a tree block in thehorizontal direction is re-segmented. In this case, when a tree block(parent block) is halved in the horizontal direction, the re-halving ofthe segment block is permitted only in the vertical direction, and theblock is halved in the vertical direction automatically. Quartering of achild block resulting from halving a tree block (parent block) may becompletely prohibited. This prohibits a block from being segmented inthe same direction as the parent block and so prevents blocksegmentation that results in a rectangle further elongated in thelateral direction, facilitating the encoding and decoding process.

The process shown in the flowchart of FIG. 10 is performed for eachblock resulting from halving a parent block in the horizontal direction.The blocks resulting from halving a parent block is also encoded anddecoded inside from top to bottom.

A description will now be given of the process of each block resultingfrom halving a tree block in the vertical direction with reference tothe flowchart of FIG. 12.

When a tree block is halved in the vertical direction, a determinationis made as to whether to quarter each block resulting from halving thetree block is quartered in the horizontal and vertical directions inside(S1301).

When it is determined to quarter the block inside (S1301: Yes), theblock is quartered inside (S1302), and the blocks resulting fromquartering the block in the horizontal and vertical directions areprocessed respectively (S1303).

When it is determined not to quarter the block inside (S1301: No), adetermination is made as to whether to halve the block inside again(S1304).

When it is determined to halve the block again (S1304: Yes), the blockis halved inside in the horizontal direction (S1305), and the blocksresulting from halving the block in the horizontal direction areprocessed respectively (S1306).

When it is determined not to halve the block again (S1304: No), theblock is not segmented inside again and the block segmentation processis terminated (S1307).

FIG. 13 shows how a block resulting from halving a tree block in thevertical direction is re-segmented. In this case, when a tree block(parent block) is halved in the vertical direction, the re-halving ofthe segment block is permitted only in the horizontal direction, and theblock is halved in the horizontal direction automatically. Quartering ofa child block resulting from halving a tree block (parent block) may becompletely prohibited. This prohibits a block from being segmented inthe same direction as the parent block and so prevents blocksegmentation that results in a rectangle further elongated in thevertical direction, facilitating the encoding and decoding process.

The process shown in the flowchart of FIG. 12 is performed for eachblock resulting from halving a parent block in the vertical direction.The blocks resulting from halving a parent block are also encoded anddecoded inside from left to right.

While re-segmentation of a block resulting from segmenting a tree blockhas been described above, a parent block need not be a tree block. Forexample. the above process may be applied to the segmentation of a blockresulting from quartering a tree block (128×128) and further quarteringor halving the block (64×64) resulting from quartering the tree block.

A description will now be given of the operation of the blocksegmentation unit 202 of the image decoding device 200. The blocksegmentation unit 202 segments a block through the same processing stepsas performed in the block segmentation unit 101 of the image encodingdevice 100. The block segmentation unit 101 of the image encoding device100 selects a pattern of block segmentation and outputs blocksegmentation information indicating the selection. The blocksegmentation unit 202 of the image decoding device differs in that itsegments a block by using the block segmentation information retrievedfrom the bitstream by decoding the bitstream and employs a syntaxstructure in which the block segmentation information is retrieved fromthe bitstream by decoding the bitstream such that the information thatlacks an option is not transferred in the bitstream when re-segmentationin the same direction is prohibited.

FIG. 14 shows an example of syntax (syntactic rule of a bitstream)related to block segmentation according to the first embodiment. Forsegmentation of a tree block inside, a flag (4 division flag) indicatingwhether to quarter the tree block is first transmitted and received. Inthe case the tree block is quartered (4 division flag is set to 1), thetree block is quartered and the process is terminated. The blockresulting from quartering the tree block is then re-segmented insideagain according to the syntax shown in FIG. 14. In the case the treeblock is not quartered (4_division_flag is set to 0), a flag(2_division_flag) indicating whether to halve the tree block istransmitted and received. In the case the tree block is halved(2_division_flag is set to 1), a flag (2_division_direction) indicatingthe direction of halving is transmitted and received.2_division_direction set to 1 means segmentation in the verticaldirection, and 2_division_direction set to 0 means segmentation in thehorizontal direction. The block resulting from halving the tree block isthen re-segmented inside again according to the syntax shown in FIG. 14.In the case the tree block is not halved (2_division_flag is set to 0),the tree block is not segmented, and the process is terminated.

A description will now be given of the process of re-segmenting theblock resulting from quartering or halving a block will be described.The process of re-segmenting the block inside also uses the syntax shownin FIG. 14 but differs from the process of segmenting a tree block inthat the direction of halving is restricted. Specifically, when a treeblock is halved and the block resulting from halving the tree block isre-segmented, segmentation in the same direction as the direction ofhalving the tree block is prohibited. This prevents a block resultingfrom the segmentation from being a further elongated rectangle, therebypreventing an increase in the memory bandwidth necessary for intraprediction and inter prediction. Details of prevention of an increase inthe memory bandwidth will be discussed later.

Of course, the number of times of halving in the same direction may becounted, and segmentation in the same direction may be restricted whenthe number of times exceeds a predetermined count. For example, halvingin the same direction may permitted twice, but halving in the samedirection for the third time may be prohibited.

Referring to the syntax of FIG. 14, quartering is selectedpreferentially, and the information indicating whether to quarter ablock is transmitted and received before the information indicatingwhether to halve the block. In the case halving is selectedpreferentially, on the other hand, the syntax may be such that theinformation indicating whether to halve a block is transmitted andreceived before the information indicating whether to quarter the block.This is because the volume of the code transmitted in a bitstream willbe smaller by transmitting and receiving an event that is more likely tooccur. In other words, an estimation is made in advance to see which ofquartering and halving is more likely to occur and the syntax isconfigured to first transmit and receive segmentation informationindicating the segmentation that is more likely to occur. For example,by indicating whether to prioritize quartering or prioritize halvingwhen transmitting and receiving the header information of an image, theencoding device can adaptively determine a prioritized segmentation type(the number of segment blocks) that will result in a higher codingefficiency, and the decoding device can segment a tree block accordingto the syntax based on the selected prioritized segmentation type.

In the image encoding device 100 and the image decoding device 200,intra prediction or inter prediction is performed by using segmentedblocks. Both intra prediction and inter prediction accompany copying ofpixels from a memory.

FIGS. 15A-15D show an example of intra prediction. FIGS. 15A and 15Bshow prediction directions and mode numbers for intra prediction. Inintra prediction, a predicted image of a block subject to encoding ordecoding is generated by copying pixels from the encoded or decodedpixels in proximity to the block subject to encoding or decoding, asshown in FIGS. 15C and 15D. In intra prediction, generation of apredicted image and generation of encoded or decoded pixels are repeatedin units of blocks. Therefore, the process proceeds sequentially inunits of blocks so that the smaller a block is segmented inside, thelarger the load from the whole process. Also, the more elongated theshape of a rectangular block, the heavier the process of copying pixelsfrom the memory. Encoding and decoding requires orthogonal transform ofa residual signal. Therefore, the larger the types of sizes ofrectangles, the more numerous the necessary types of orthogonaltransform and the larger the resultant circuit scale. Therefore, thememory bandwidth necessary for intra prediction is prevented fromincreasing when a block is halved inside, by restricting the block frombeing halved in the same direction as the direction in which the parentblock is segmented.

FIG. 16 shows an example of inter prediction. In inter prediction, apredicted image of a block subject to encoding or decoding is generatedby copying, in units of blocks, pixels from the pixels included in theencoded or decoded image. Inter prediction often requires a deviceconfiguration in which pixels are copied from a reference image in unitsof blocks such that acquisition in units of memory management includingnecessary pixels is required. Therefore, the smaller a block issegmented and the more elongated the shape of a rectangular block, thelarger the load from the whole process. Further, motion compensation ofdecimal accuracy in a reference image using an interpolation filterrequires copying several pixels in addition to the pixels included inthe block. Therefore, the smaller the size of a block, the larger therelative proportion of the several pixels added and the larger the loadfrom the whole process. Accordingly, the memory bandwidth necessary forintra prediction is prevented from increasing when a block is halvedinside, by restricting the block from being halved in the same directionas the direction in which the parent block is segmented.

Second Embodiment

A description will be given of an image encoding device and an imagedecoding device according to the second embodiment of the presentinvention. The second embodiment differs from the first embodiment inthat, when a block is of a predetermined size or smaller, furthersegmentation of the block inside is restricted and is identical to thefirst embodiment in the other respects. This prevents the load from thewhole process from continuing to increase as a block is segmented insideinto smaller blocks.

FIGS. 17 and 18 show a syntax related to block segmentation according tothe second embodiment. The difference from the syntax of FIG. 14according to the first embodiment is that block segmentation is enabledonly when the size of the initial block is larger than a predeterminedsize. In the case of FIG. 17, a block including more than 64 pixelsinside can be quartered or halved.

In the case a difference between the number of pixels in a blockresulting from quartering and that of a block resulting from halving isconsidered, quartering is permitted when the number of pixels in theblock is larger than 64, and halving is permitted when the number ofpixels in the block is larger than 32. In this way, restriction on thenumber of pixels in the block resulting from the segmentation isprecisely controlled.

Third Embodiment

A description will be given of an image encoding device and an imagedecoding device according to the third embodiment. The third embodimentdiffers from the first embodiment in that further vertical segmentationof a block resulting from vertical segmentation is restricted and isidentical to the first embodiment in the other respects.

Normally, pixel information of an image is stored in a one-dimensionalmemory in the order of raster scan. In a one-dimensional memory, pixelsin the horizontal direction are stored relatively close to each other,and pixels in the vertical direction are stored relatively remote fromeach other. It is therefore easy to access pixels in the horizontaldirection, but it is not easy to access pixels in the verticaldirection. In the case of a block including 16 horizontal pixels×8vertical pixels and a block including 8 horizontal pixels×16 verticalpixels, for example, the numbers of pixels are identical, but the blockof 8 horizontal pixels×16 vertical pixels consumes a more extensiverange of the memory to store the pixels than the block of 16 horizontalpixels×8 vertical pixels. Therefore, a larger memory bandwidth will berequired for transfer of pixels when motion compensation is used.

FIG. 19 shows a syntax related to block segmentation according to thethird embodiment. The difference from the syntax of FIG. 14 according tothe first embodiment is that further vertical segmentation inside isprohibited only when a parent block is halved vertically. Specifically,when the parent block is halved vertically and the child block should behalved inside, selection between horizontal and vertical is notavailable, and horizontal segmentation is automatically selected, asshown in FIG. 20.

Fourth Embodiment

A description will be given of an image encoding device and an imagedecoding device according to the fourth embodiment of the presentinvention. The fourth embodiment differs from the first embodiment inthat, when a block is halved and then the resultant block inside isquartered, further segmentation of the resultant block inside isprohibited and is identical to the first embodiment in the otherrespects.

FIG. 21 shows a syntax related to block segmentation according to thefourth embodiment. As shown in FIG. 22, when a parent block is halvedand then the resultant block inside is quartered, 2 division after 4division flag is set to 1, prohibiting all subsequent segmentation.

That a block is halved and then quartered means that non-selection ofquartering when halving is selected has been established. Therefore, thelikelihood that further block segmentation is necessary after the blockis halved and then quartered is low. In the case such furthersegmentation is necessary, quartering may be selected from the outset.In the case a block is halved and then quartered, the resultant blockwill already have a rectangular shape. Therefore, an attempt to prohibitthe direction of halving after the quartering will complicate theprocess. By uniformly prohibiting subsequent segmentation of a blockresulting from halving and subsequent quartering, a determination as towhether block segmentation is enabled is prevented from becomingcomplicated. Uniform prohibition of further block segmentation in ablock resulting from halving and subsequent quartering makes itunnecessary to transmit and receive the selection not to segment theblock and reduces the volume of the code transmitted.

It will of course be possible to combine a plurality of the schemes forrestriction of block segmentation according to first through fourthembodiments.

The bitstream of images output from the image encoding device accordingto any of the embodiments described above has a predefined format sothat it can be decoded in accordance with the encoding method used inthe embodiments. The image decoding device compatible with the imageencoding device is capable of decoding the bitstream of the predefineddata format.

If a wired or wireless network is used to exchange bitstreams betweenthe image encoding device and the image decoding device, the bitstreammay be converted into a data format suited to the mode of transmissionover the communication channel and be transmitted accordingly. In thiscase, there should be provided a transmitting device for converting thebitstreams output from the image encoding device into encoded data of adata format suited to the mode of transmission over the communicationchannel and for transmitting the bitstreams over the network, and areceiving device for receiving the bitstreams from the network torecover the bitstreams and supplying the recovered bitstreams to theimage decoding device.

The transmitting device includes a memory for buffering bitstreamsoutput from the image encoding device, a packet processing unit forpacketizing the bitstreams, and a transmitting unit for transmitting thepacketized bitstreams over the network. The receiving device includes areceiving unit for receiving the packetized encoded data over thenetwork, a memory for buffering the received encoded data, and a packetprocessing unit for subjecting the encoded data to a packet process soas to generate bitstreams and providing the generated bitstreams to theimage decoding device.

Further, a display unit for displaying an image decoded by the imagedecoding device may be added to configure a display device. In thatcase, the display unit reads a decoded image signal generated by thedecoded image signal superimposition unit 205 and stored in the decodedimage memory 206 and displays the image on the screen.

Further, an imaging device may be configured by adding an imaging unitand feeding a captured image to the image encoding device. In that case,the imaging unit feeds an image signal captured to the blocksegmentation unit 101.

The above-described processes related to encoding and decoding can ofcourse be implemented by hardware-based apparatus for transmission,storage, or reception.

Alternatively, the processes can be implemented by firmware stored in aread-only memory (ROM), a flash memory, etc., or by software on acomputer, etc. The firmware program or the software program may be madeavailable on, for example, a computer readable recording medium.Alternatively, the programs may be made available from a server via awired or wireless network. Still alternatively, the programs may be madeavailable in the form of data transmission over terrestrial or satellitedigital broadcast systems.

Described above is an explanation based on an exemplary embodiment. Theembodiment is intended to be illustrative only and it will be understoodby those skilled in the art that various modifications to constitutingelements and processes could be developed and that such modificationsare also within the scope of the present invention.

What is claimed is:
 1. An image encoding device adapted to segment animage into blocks and encode the image in units of blocks resulting fromsegmenting the image, comprising: a block segmentation unit thatrecursively segments the image into rectangles of a predetermined sizeto generate a target block subject to encoding; and an encoding unitthat encodes block segmentation information of the target block, whereinthe block segmentation unit includes: a quartering unit that quartersthe target block in recursive segmentation in a horizontal direction anda vertical direction to generate four blocks; and a halving unit thathalves the target block in recursive segmentation in the horizontaldirection or the vertical direction to generate two blocks, wherein whenprevious recursive segmentation is halving and the target block is of apredetermined size, the halving unit prohibits the target block subjectto current recursive segmentation from being segmented in the samedirection as the direction in which the target block was segmented inthe previous recursive segmentation and thereby prevents blocksegmentation that results in a rectangle further elongated in the samedirection.
 2. An image encoding method adapted to segment an image intoblocks and encode the image in units of blocks resulting from segmentingthe image, comprising: recursively segmenting the image into rectanglesof a predetermined size to generate a target block subject to encoding;and encoding block segmentation information of the target block, whereinthe segmenting includes: quartering the target block in recursivesegmentation in a horizontal direction and a vertical direction togenerate four blocks; and halving the target block in recursivesegmentation in the horizontal direction or the vertical direction togenerate two blocks, wherein when previous recursive segmentation ishalving and the target block is of a predetermined size, the halvingprohibits the target block subject to current recursive segmentationfrom being segmented in the same direction as the direction in which thetarget block was segmented in the previous recursive segmentation andthereby prevents block segmentation that results in a rectangle furtherelongated in the same direction.
 3. A non-transitory computer-readablemedium having an image encoding program adapted to segment an image intoblocks and encode the image in units of blocks resulting from segmentingthe image, the program comprising computer-implemented modulesincluding: a block segmentation module that recursively segments theimage into rectangles of a predetermined size to generate a target blocksubject to encoding; and an encoding module that encodes blocksegmentation information of the target block, wherein the blocksegmentation module includes: a quartering module that quarters thetarget block in recursive segmentation in a horizontal direction and avertical direction to generate four blocks; and a halving module thathalves the target block in recursive segmentation in the horizontaldirection or the vertical direction to generate two blocks, wherein whenprevious recursive segmentation is halving and the target block is of apredetermined size, the halving module prohibits the target blocksubject to current recursive segmentation from being segmented in thesame direction as the direction in which the target block was segmentedin the previous recursive segmentation and thereby prevents blocksegmentation that results in a rectangle further elongated in the samedirection.
 4. An image decoding device adapted to decode an image inunits of blocks resulting from segmenting the image, comprising: a blocksegmentation unit that generates a target block subject to decodingbased on decoded recursive block segmentation information; and adecoding unit that decodes the target block, wherein the blocksegmentation unit includes: a quartering unit that quarters the targetblock in recursive segmentation in a horizontal direction and a verticaldirection to generate four blocks; and a halving unit that halves thetarget block in recursive segmentation in the horizontal direction orthe vertical direction to generate two blocks, wherein when previousrecursive segmentation is halving and the target block is of apredetermined size, the halving unit prohibits the target block subjectto current recursive segmentation from being segmented in the samedirection as the direction in which the target block was segmented inthe previous recursive segmentation and thereby prevents blocksegmentation that results in a rectangle further elongated in the samedirection.
 5. An image decoding method adapted to decode an image inunits of blocks resulting from segmenting the image, comprising:generating a target block subject to decoding based on decoded recursiveblock segmentation information; and decoding the target block, whereinthe segmenting includes: quartering the target block in recursivesegmentation in a horizontal direction and a vertical direction togenerate four blocks; and halving the target block in recursivesegmentation in the horizontal direction or the vertical direction togenerate two blocks, wherein when previous recursive segmentation ishalving and the target block is of a predetermined size, the halvingprohibits the target block subject to current recursive segmentationfrom being segmented in the same direction as the direction in which thetarget block was segmented in the previous recursive segmentation andthereby prevents block segmentation that results in a rectangle furtherelongated in the same direction.
 6. A non-transitory computer-readablemedium having an image decoding program adapted to decode an image inunits of blocks resulting from segmenting the image, the programcomprising computer-implemented modules including: a block segmentationmodule that generates a target block subject to decoding based ondecoded recursive block segmentation information; and a decoding modulethat decodes the target block, wherein the block segmentation moduleincludes: a quartering module that quarters the target block inrecursive segmentation in a horizontal direction and a verticaldirection to generate four blocks; and a halving module that halves thetarget block in recursive segmentation in the horizontal direction orthe vertical direction to generate two blocks, wherein when previousrecursive segmentation is halving and the target block is of apredetermined size, the halving module prohibits the target blocksubject to current recursive segmentation from being segmented in thesame direction as the direction in which the target block was segmentedin the previous recursive segmentation and thereby prevents blocksegmentation that results in a rectangle further elongated in the samedirection.